package Text;

import java.util.Scanner;

public class Demo9 {
    public static void main(String[] args) {
        System.out.print("输入月利润：");
        double money = new Scanner(System.in).nextDouble();
        if (money < 0) {//数据校验
            System.err.println("数据不合法");
        }
        double bonus = 0;//定义奖金

        //计算奖金
        if (money <= 100000) {
            bonus = money * 0.1;
        } else if (money > 100000 && money <= 200000) {
            bonus = 10000 + (money - 100000) * 0.075;
        } else if (money > 200000 && money <= 400000) {
            bonus = 10000 + (200000 - 100000) * 0.075 +
                    (money - 200000) * 0.05;
        } else if (money > 400000 && money <= 600000) {
            bonus = 10000 + (200000 - 100000) * 0.075 +
                    (400000 - 200000) * 0.05 +
                    (money - 400000) * 0.03;
        } else if (money > 600000 && money <= 1000000) {
            bonus = 10000 + (200000 - 100000) * 0.075 +
                    (400000 - 200000) * 0.05 +
                    (600000 - 400000) * 0.03 +
                    (money - 600000) * 0.015;
        } else {
            bonus = 10000 + (200000 - 100000) * 0.075 +
                    (400000 - 200000) * 0.05 +
                    (600000 - 400000) * 0.03 +
                    (1000000 - 600000) * 0.015 +
                    (money - 1000000) * 0.001;
        }
        System.out.println("奖金总数为：" + bonus);

    }
}
